package com.yanqu.road.server.timer.xingyoushanshui;

import com.yanqu.road.server.manager.activity.ActivityMgr;
import com.yanqu.road.server.manager.activity.xingyou.CrossXingYouActivity;
import com.yanqu.road.server.manager.activity.xingyou.CrossXingYouShanShuiMgr;
import com.yanqu.road.utils.executor.GeneralTask;

import java.util.Map;

public class XingYouShanShuiSettleTask extends GeneralTask {

    @Override
    public void doRun() {
        try {
            for (Map.Entry<Integer, Map<Integer, CrossXingYouActivity>> entry : CrossXingYouShanShuiMgr.getActivityMap().entrySet()) {
                for (Map.Entry<Integer, CrossXingYouActivity> activityEntry : entry.getValue().entrySet()) {
                    CrossXingYouActivity value = activityEntry.getValue();
                    if (ActivityMgr.activityInTime(value.getConfig().getActivityInfo())) {
                        value.checkDriftTimeout();
                    }
                }
            }
        }catch (Exception e){
            getLOGGER().error("error : ", e);
        }
    }
}
